
package com.yunfei.api;

import com.yunfei.bo.TblobstorageBo;
import com.yunfei.result.ResultModel;
import com.yunfei.services.TblobstorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 份额确认生成书
 * 先生成确认书，如果成功，返回文件大小
 * @Author: zhengyunfei
 * @Date: 2018/6/15
 * @time:11:26
 */
@RestController
@RequestMapping("/api/crm/tblobstorage")
public class TCustBuyinApiController {
    @Autowired
    private TblobstorageService tblobstorageService;

    @PostMapping("/get")
    @ResponseBody
    public Object post(){
        ResultModel resultModel=new ResultModel();
        //查询附件需要
        int xh=tblobstorageService.getTblobStorageSeq();
        try{
            resultModel.setData(xh);

        }catch (Exception e){

        }
        return resultModel;
    }
    /**
    * @Description: 获取信息
    * @Author: zhengyunfei
    * @Date: 2018/12/13
    * @time:14:18
    */
    @GetMapping("/get")
    @ResponseBody
    public Object get(){
        ResultModel resultModel=new ResultModel();
        //查询附件需要
        int xh=tblobstorageService.getTblobStorageSeq();
        try{
            resultModel.setData(xh);

        }catch (Exception e){

        }
        return resultModel;
    }
    /**
    * @Description: 写入日志信息
    * @Author: zhengyunfei
    * @Date: 2018/12/13
    * @time:14:18
    */
    @PostMapping("/add")
    @ResponseBody
    public Object insert(TblobstorageBo tblobstorageBo){
        ResultModel resultModel=new ResultModel();
        //查询附件需要
        try{
            tblobstorageService.add(tblobstorageBo);
            resultModel.setCode(0);
            resultModel.setMessage("成功");

        }catch (Exception e){
            resultModel.setCode(-1);
            resultModel.setMessage("失败");

        }
        return resultModel;
    }
}
